﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DotBeer.UI.WPFClient">
	<SolidColorBrush x:Key="ListBorder" Color="#FF7F9DB9"/>
	<Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="Padding" Value="2"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="Template" Value="{DynamicResource TextBoxControlTemplate}"/>
        <Style.Triggers>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="ToolTip"
                        Value="{Binding RelativeSource={x:Static RelativeSource.Self}, 
                        Path=(Validation.Errors).CurrentItem.ErrorContent}"/>
            </Trigger>
        </Style.Triggers>
	</Style>
	<ControlTemplate x:Key="TextBoxControlTemplate" TargetType="{x:Type TextBox}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" BorderThickness="{DynamicResource ThicknessSize_1}" Background="{DynamicResource BrushControlBackgroundLight}" BorderBrush="{DynamicResource ImpassiveColor4}" CornerRadius="{DynamicResource CornerRadiusSmall}">
			<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Style="{DynamicResource ScrollViewerListViewStyle}"/>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<!-- Resource dictionary entries should be defined here. -->
</ResourceDictionary>